<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c_rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt"  prefix="fmt_rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ page language="java" 
	import="java.util.*" 
	import="com.jp.fm.data.*"
	import="com.jp.fm.*"
	pageEncoding="ISO-8859-1"%>
<div id="trends" class="section">
	<h2 class="trendsh2">Net Income <c:out value="${monthLongStart}"/> - <c:out value="${monthLongEnd}"/></h2>
	<ul class="trendsul" id="">
		<c:set var="monthCount" value="1"/>
		<c:forEach var="monthTrend" items="${trendList}">				
			<c:set var="monthClass" value="positive"/>				
			<c:set var="monthHeight" value="0"/>
			<c:set var="monthTop" value="0"/>				
			<c:if test="${ monthTrend['monthTranTotal'] ne 0 }">
				<c:set var="monthHeight" value="${((monthTrend['monthTranTotal']/monthMax)*100)/2}"/>					
				<c:if test="${ monthHeight lt 0 }">
					<c:set var="monthHeight" value="${monthHeight * -1}"/>
				</c:if>
			</c:if>		
			<c:set var="monthTop" value="${ (100 - (monthHeight*2)) / 2 }"/>										
			<c:if test="${monthTrend['monthTranTotal'] lt 0}">
				<c:set var="monthClass" value="debt"/>
				<c:set var="monthTop" value="50"/>
			</c:if>
		
			<li class="bucket bucket-<c:out value='${monthCount}'/>" id="">
				<label class="label1"><c:out value='${monthTrend["monthShort"]}'/></label>
				<a url="/fm/secured/ShowTransactions?startDateDatepicker=<c:out value='${monthTrend["monthStartDate"]}'/>&amp;endDateDatepicker=<c:out value='${monthTrend["monthEndDate"]}'/>" class="<c:out value='${monthClass}'/> click-link" style="height: <c:out value='${monthHeight}'/>%; top: <c:out value='${monthTop}'/>%;" title="<c:out value='${monthTrend["monthLong"]}'/>: <fmt:formatNumber value='${monthTrend["monthTranTotal"]}' type='currency'/>">&nbsp;</a>
			</li>
			<c:set var="monthCount" value="${monthCount+1}"/>
		</c:forEach>
		<li class="ticks">
			<div class="top"><p><fmt:formatNumber value='${monthMax}' type='currency'/></p></div>
			<div></div>
			<div></div>
			<div></div>
			<div class="zero"><p>0</p></div>
			<div></div>
			<div></div>
			<div class="bottom"><p>-<fmt:formatNumber value='${monthMax}' type='currency'/></p></div>
		</li>
	</ul>
	<table class="ui-widget ui-widget-content dialogtable">
		<thead>
			<tr class="ui-widget-header">
				<th>Income</th>
				<th>Spent</th>
				<th>Net</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td><fmt:formatNumber value='${sixMonthIncome}' type='currency'/></td>
				<td><fmt:formatNumber value='${sixMonthSpent}' type='currency'/></td>
				<td><fmt:formatNumber value='${sixMonthNet}' type='currency'/></td>
			</tr>
		</tbody>
	</table>
</div>